<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Video
 * @copyright  Copyright 2006-2010 Idragonsolution Developments
 * @license    http://idragonsolution.com/
 * @version    $Id: Composer.php 9747 2012-07-26 02:08:08Z Thien $
 * @author     Thien
 */

/**
 * @category   Application_Extensions
 * @package    Recorder
 * @copyright  Copyright 2006-2010 Idragonsolution Developments
 * @license    http://idragonsolution.com/
 */
class Recorder_Plugin_Composer extends Core_Plugin_Abstract
{
  public function onAttachRecorder($data)
  {
    if( !is_array($data) || empty($data['recorder_id']) ) {
      return;
    }

    $recorder = Engine_Api::_()->getItem('recorder', $data['recorder_id']);
    $recorder->title = $data['title'];
    $recorder->search = 1;
    $recorder->save();
    
    return  $recorder;
  }
}